package ooday02;

public class Test {
    public static void main(String[] args) throws InterruptedException {
        A a = new A();

        a.start();
        Thread.sleep(1000);
        a.running = false;
    }
}
class A extends Thread{
    volatile boolean running = true;

    @Override
    public void run() {
        int n = 1;
        while (running) {
            System.out.println(n + "hello");
            ++n;
        }
    }
}
